package dmxGroupControl.ui;
	
import java.net.URL;

import dmxGroupControl.LightController;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;


public class UniverseEditWindow extends Application {
	
    String venueFile;
    
    public UniverseEditWindow(String venueFile)
    {
        this.venueFile = venueFile;
    }
	
	@Override
	public void start(Stage primaryStage) 
	{
		try 
		{
			URL location = getClass().getResource("/resources/UniverseEditWindow.fxml");
			FXMLLoader fxmlLoader = new FXMLLoader(location);

			LightController.Initialize(venueFile);
			LightController.GetInstance().SetSolversEnabled(false);
			
			primaryStage.setOnCloseRequest((event) -> LightController.GetInstance().close());
			
			Pane root = fxmlLoader.load();
			Scene scene = new Scene(root);
			scene.getStylesheets().add(getClass().getResource("/resources/UniverseEditWindow.css").toExternalForm());
			primaryStage.setScene(scene);
			
			primaryStage.show();
			
		} catch(Exception e) 
		{
			e.printStackTrace();
		}
	}
	
}
